# Contributor: Danilo Falcão <danilo@falcao.org>
# Maintainer: Danilo Falcão <danilo@falcao.org>
pkgname=py3-pelican
_pkgname=pelican
pkgver=4.2.0
pkgrel=2
pkgdesc="Static site generator written in Python"
options="!check" # Tests require locale support
url="https://getpelican.com"
arch="noarch"
license="AGPL-3.0-only"
depends="
	python3
	py3-feedgenerator
	py3-jinja2
	py3-pygments
	py3-docutils
	py3-tz
	py3-blinker
	py3-unidecode
	py3-six
	py3-dateutil
	py3-markdown
	"
checkdepends="py3-django"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	default_prepare

	# remove shebang from python files
	sed -i '1d' \
		pelican/tools/*.py \
		pelican/tools/templates/*.py.jinja2
}

replaces="pelican" # Backwards compatibility
provides="pelican=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="094197407bb5e17cbf4a3c0f6df078a321de4b2373da2bd608baf6f82fd634986da0dae10547bcd9644f6b83e9cb4aa204a1a36e347a8a6248a3f6a197ebcff4  pelican-4.2.0.tar.gz"
